\hypertarget{classduye_1_1_udp_server}{\section{duye\-:\-:Udp\-Server Class Reference}
\label{classduye_1_1_udp_server}\index{duye\-::\-Udp\-Server@{duye\-::\-Udp\-Server}}
}


udp server socket class  




{\ttfamily \#include $<$duye\-\_\-udp\-\_\-server.\-h$>$}

Inheritance diagram for duye\-:\-:Udp\-Server\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classduye_1_1_udp_server}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
bool \hyperlink{classduye_1_1_udp_server_ac138af77ebf8f8e5370c247378b43682}{init\-Server} (const \hyperlink{classduye_1_1_net_server_para}{Net\-Server\-Para} \&server\-Para)
\begin{DoxyCompactList}\small\item\em init udp server, rewrite abstract interface from \hyperlink{classduye_1_1_net_server}{Net\-Server} \end{DoxyCompactList}\item 
virtual bool \hyperlink{classduye_1_1_udp_server_a1679cf6b3582270492e18bb683ac81f5}{start\-Server} ()
\begin{DoxyCompactList}\small\item\em start udp server, rewrite abstract interface from \hyperlink{classduye_1_1_net_server}{Net\-Server} \end{DoxyCompactList}\item 
virtual bool \hyperlink{classduye_1_1_udp_server_a7e06bf397f1b1716c737fd59747d23fe}{stop\-Server} ()
\begin{DoxyCompactList}\small\item\em stop tcp server, implementation abstract interface for \hyperlink{classduye_1_1_net_server}{Net\-Server} \end{DoxyCompactList}\item 
const \hyperlink{classduye_1_1_i_pv4_addr}{I\-Pv4\-Addr} \& \hyperlink{classduye_1_1_udp_server_a507fc48c1dc9e56b29586a247b6dfeb0}{ipv4\-Addr} ()
\begin{DoxyCompactList}\small\item\em get server I\-Pv4 address \end{DoxyCompactList}\item 
int64 \hyperlink{classduye_1_1_udp_server_a0e239129f7adbeec9af1b07183c0b154}{recvfrom} (\hyperlink{classduye_1_1_i_pv4_addr}{I\-Pv4\-Addr} \&src\-Addr, int8 $\ast$buffer, const uint64 size, const bool is\-Block=true)
\begin{DoxyCompactList}\small\item\em receive data \end{DoxyCompactList}\item 
int64 \hyperlink{classduye_1_1_udp_server_ae9e5d8e0b0579bf08756b5cfda8e43f1}{sendto} (\hyperlink{classduye_1_1_i_pv4_addr}{I\-Pv4\-Addr} \&dst\-Addr, const int8 $\ast$data, const uint64 len)
\begin{DoxyCompactList}\small\item\em send data for U\-D\-P protocol \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
udp server socket class 

\subsection{Member Function Documentation}
\hypertarget{classduye_1_1_udp_server_ac138af77ebf8f8e5370c247378b43682}{\index{duye\-::\-Udp\-Server@{duye\-::\-Udp\-Server}!init\-Server@{init\-Server}}
\index{init\-Server@{init\-Server}!duye::UdpServer@{duye\-::\-Udp\-Server}}
\subsubsection[{init\-Server}]{\setlength{\rightskip}{0pt plus 5cm}bool duye\-::\-Udp\-Server\-::init\-Server (
\begin{DoxyParamCaption}
\item[{const {\bf Net\-Server\-Para} \&}]{server\-Para}
\end{DoxyParamCaption}
)}}\label{classduye_1_1_udp_server_ac138af77ebf8f8e5370c247378b43682}


init udp server, rewrite abstract interface from \hyperlink{classduye_1_1_net_server}{Net\-Server} 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em server\-Para} & \-: server information \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\hypertarget{classduye_1_1_udp_server_a507fc48c1dc9e56b29586a247b6dfeb0}{\index{duye\-::\-Udp\-Server@{duye\-::\-Udp\-Server}!ipv4\-Addr@{ipv4\-Addr}}
\index{ipv4\-Addr@{ipv4\-Addr}!duye::UdpServer@{duye\-::\-Udp\-Server}}
\subsubsection[{ipv4\-Addr}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf I\-Pv4\-Addr}\& duye\-::\-Udp\-Server\-::ipv4\-Addr (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classduye_1_1_udp_server_a507fc48c1dc9e56b29586a247b6dfeb0}


get server I\-Pv4 address 

\begin{DoxyReturn}{Returns}
I\-Pv4 address 
\end{DoxyReturn}
\hypertarget{classduye_1_1_udp_server_a0e239129f7adbeec9af1b07183c0b154}{\index{duye\-::\-Udp\-Server@{duye\-::\-Udp\-Server}!recvfrom@{recvfrom}}
\index{recvfrom@{recvfrom}!duye::UdpServer@{duye\-::\-Udp\-Server}}
\subsubsection[{recvfrom}]{\setlength{\rightskip}{0pt plus 5cm}int64 duye\-::\-Udp\-Server\-::recvfrom (
\begin{DoxyParamCaption}
\item[{{\bf I\-Pv4\-Addr} \&}]{src\-Addr, }
\item[{int8 $\ast$}]{buffer, }
\item[{const uint64}]{size, }
\item[{const bool}]{is\-Block = {\ttfamily true}}
\end{DoxyParamCaption}
)}}\label{classduye_1_1_udp_server_a0e239129f7adbeec9af1b07183c0b154}


receive data 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt out}  & {\em src\-Addr} & \-: source address \\
\hline
\mbox{\tt out}  & {\em buffer} & \-: output buffer \\
\hline
\mbox{\tt in}  & {\em size} & \-: buffer size \\
\hline
\mbox{\tt in}  & {\em is\-Block} & \-: block or unblock, default block \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\-: size on success, return the number of characters received. on error, return -\/1 
\end{DoxyReturn}
\begin{DoxyNote}{Note}

\end{DoxyNote}
\hypertarget{classduye_1_1_udp_server_ae9e5d8e0b0579bf08756b5cfda8e43f1}{\index{duye\-::\-Udp\-Server@{duye\-::\-Udp\-Server}!sendto@{sendto}}
\index{sendto@{sendto}!duye::UdpServer@{duye\-::\-Udp\-Server}}
\subsubsection[{sendto}]{\setlength{\rightskip}{0pt plus 5cm}int64 duye\-::\-Udp\-Server\-::sendto (
\begin{DoxyParamCaption}
\item[{{\bf I\-Pv4\-Addr} \&}]{dst\-Addr, }
\item[{const int8 $\ast$}]{data, }
\item[{const uint64}]{len}
\end{DoxyParamCaption}
)}}\label{classduye_1_1_udp_server_ae9e5d8e0b0579bf08756b5cfda8e43f1}


send data for U\-D\-P protocol 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em dst\-Addr} & \-: destination address \\
\hline
\mbox{\tt in}  & {\em data} & \-: send data \\
\hline
\mbox{\tt in}  & {\em len} & \-: data length \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
on success, return the number of characters sent. on error, return -\/1 
\end{DoxyReturn}
\hypertarget{classduye_1_1_udp_server_a1679cf6b3582270492e18bb683ac81f5}{\index{duye\-::\-Udp\-Server@{duye\-::\-Udp\-Server}!start\-Server@{start\-Server}}
\index{start\-Server@{start\-Server}!duye::UdpServer@{duye\-::\-Udp\-Server}}
\subsubsection[{start\-Server}]{\setlength{\rightskip}{0pt plus 5cm}virtual bool duye\-::\-Udp\-Server\-::start\-Server (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{classduye_1_1_udp_server_a1679cf6b3582270492e18bb683ac81f5}


start udp server, rewrite abstract interface from \hyperlink{classduye_1_1_net_server}{Net\-Server} 

\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}


Implements \hyperlink{classduye_1_1_net_server_aa8c00e9883e8094f9348aeb49e539005}{duye\-::\-Net\-Server}.

\hypertarget{classduye_1_1_udp_server_a7e06bf397f1b1716c737fd59747d23fe}{\index{duye\-::\-Udp\-Server@{duye\-::\-Udp\-Server}!stop\-Server@{stop\-Server}}
\index{stop\-Server@{stop\-Server}!duye::UdpServer@{duye\-::\-Udp\-Server}}
\subsubsection[{stop\-Server}]{\setlength{\rightskip}{0pt plus 5cm}virtual bool duye\-::\-Udp\-Server\-::stop\-Server (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{classduye_1_1_udp_server_a7e06bf397f1b1716c737fd59747d23fe}


stop tcp server, implementation abstract interface for \hyperlink{classduye_1_1_net_server}{Net\-Server} 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em server\-Para} & \-: server information \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}


Implements \hyperlink{classduye_1_1_net_server_a39bc762d23649f4dace78cafbbda7c5c}{duye\-::\-Net\-Server}.



The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
Z\-:/duye/src/duyebase/net/\hyperlink{duye__udp__server_8h}{duye\-\_\-udp\-\_\-server.\-h}\end{DoxyCompactItemize}
